package com.xm.web.controller.business;

import com.xm.common.entity.R;
import com.xm.web.service.ITbBookService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author yousj
 * @since 2021/8/29
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/book/hot")
@Api(tags = "书籍")
public class BookHotController {

    private final ITbBookService bookService;

    @ApiOperation(value = "列表")
    @PostMapping("/list")
    @Cacheable(value = "bookAllCache", key = "'bookAllCache#3600#'")
    public R list() {
        return R.isOk(bookService.list());
    }
}
